package com.gite.nouette.admin.implementation.integrator.builder;

import java.util.ArrayList;
import java.util.List;

import com.gite.nouette.admin.contract.integrator.assembler.IAssemblerManager;
import com.gite.nouette.admin.contract.integrator.factory.IFactoryModel;
import com.gite.nouette.admin.implementation.integrator.assembler.AssemblerManagerContentImpl;
import com.gite.nouette.admin.implementation.integrator.assembler.AssemblerManagerLogImpl;

public class BuilderAdminImpl extends AbstractBuilderAdmin {

	public BuilderAdminImpl(IFactoryModel factoryModel) {
		super(factoryModel);
	}

	@Override
	public void buildManagers() {
		List<IAssemblerManager> assemblerManagers = new ArrayList<IAssemblerManager>();
		assemblerManagers
				.add(new AssemblerManagerContentImpl(getFactoryModel()));
		assemblerManagers.add(new AssemblerManagerLogImpl(getFactoryModel()));
		for (IAssemblerManager assemblerManager : assemblerManagers) {
			assemblerManager.setParentProduct(getProduct());
			assemblerManager.run();
		}
	}

	@Override
	public void buildName() {
		getProduct().setName("Administration du gîte");
	}

}
